package com.realwronger.springcool.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.realwronger.common.User;

public class DependencyInjection {

	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"dependencyInjection.xml");
		User u1 = (User) context.getBean("user1", User.class);
		System.out.println(u1);

		User u2 = (User) context.getBean("user2", User.class);
		System.out.println(u2);

		User u3 = (User) context.getBean("user3", User.class);
		System.out.println(u3);
	}

}
